/*
* Main.cpp
*
*  Created on: Jan 20, 2011
*      Author: Helpful Learn Group
*/
#include "Simulation.h"

#include <iostream>
//#include <iomanip>
using namespace std;
using namespace GSP280;

void userInput();
void welcome();



int mass = 32, radius = 5;

float omega = 7;

// 30 degrees (.52 rads)
//float angle = .52;
float angle = 30, launchX = 5, launchY = 10, targetX = 200, targetY = 50;

int main()
{
	Simulation sim;
	welcome();
	char yesNo = 'y';

	do {
		userInput(); //USER INPUT:

		// Angle is fed into Start() as degrees
		sim.Start(mass, radius, omega, angle, Vector2(launchX, launchY), Vector2(targetX, targetY));

		cout << "Try Again (y/n)?"; cin >> yesNo;

		if ( yesNo == 'n' )
		{
			cout << "Thank you for trying this humble simulation\nGood Bye!\n\n" << endl;
			break;
		}

	} while (yesNo == 'y');

	//cout << "\n\n";

	return (0);
}

void userInput()
{
	cout << "\nPlease enter the following information:\n\nMass: ";
	cin >> mass;

	cout << "\nRadius: ";
	cin >> radius;
	
	cout << "\nAngular Velocity: ";
	cin >> omega;

	cout << "\nAngle: ";
	cin >> angle;

	cout << "\nLaunch Object Location (X Y): ";
	cin >> launchX;
	cin >> launchY;

	cout << "\nTarget Object Location (X Y): ";
	cin >> targetX;
	cin >> targetY;

	cout << "\n\n";

}

void welcome()
{
	cout << "\n===========================================================\n";
	cout << "\tWelcome to the Catapult Simulation Program!\n";
	cout << "===========================================================\n";
}
